#ifndef SCREENLOCKUI_H
#define SCREENLOCKUI_H

#include "titlelabel.h"
#include "settinggroup.h"
#include "flowlayout.h"
#include "switchwidget.h"
#include "pushbuttonwidget.h"
#include "pictureunit.h"
#include <QHBoxLayout>
#include <QWidget>

class ScreenlockUi : public QWidget
{
    Q_OBJECT
public:
    ScreenlockUi();
    ~ScreenlockUi();
    void setShowOnLogin(bool b);
    void setPicture(const QString &data);
    void setPictures(const QStringList &picturePathList, const QStringList &sourcePathList);
    void createPictureUnit(const QPixmap &pixmap, const QString &filename, const bool &clicked);
    void resetClickedPic();

private:
    void initUi();
    void initScreenLock();
    void initRelateSet();
    void initSignals();

private:
    QVBoxLayout *uiLayout         = nullptr;
    QVBoxLayout *screenlockLayout = nullptr;
    QVBoxLayout *relateLayout     = nullptr;

private:
    TitleLabel   *wallpaperTitleLabel = nullptr;
    UkccFrame    *previewFrame        = nullptr;
    QHBoxLayout  *previewLayout       = nullptr;
    QLabel       *previewLabel        = nullptr;
    SettingGroup *centerGroup         = nullptr;
    SwitchWidget *showPicWidget       = nullptr;
    UkccFrame    *picBtnFrame         = nullptr;
    QVBoxLayout  *picBtnLayout        = nullptr;
    UkccFrame    *pictureFrame        = nullptr;
    FlowLayout   *pictureLayout       = nullptr;
    UkccFrame    *bottomFrame         = nullptr;
    QHBoxLayout  *bottomLayout        = nullptr;
    QPushButton  *localBtn            = nullptr;
    QPushButton  *onlineBtn           = nullptr;
    QPushButton  *resetBtn            = nullptr;

private:
    TitleLabel       *relateTitleLabel  = nullptr;
    SettingGroup     *relatedGroup      = nullptr;
    PushButtonWidget *monitorWidget     = nullptr;
    PushButtonWidget *screensaverWidget = nullptr;

private:
    PictureUnit *prePictureUnit = nullptr;
    QString     currentFile;

Q_SIGNALS:
    void showOnLoginChanged(const bool &b);
    void pictureChanged(const QString &picture);
    void localButtonClicked();
    void onlineButtonClicked();
    void resetButtonClicked();
    void toSetMonitor();
    void toSetScreensaver();
};


#endif // SCREENLOCKUI_H
